from pydantic import BaseModel, ConfigDict
from datetime import datetime


class RequestLogOut(BaseModel):
    id: int
    url: str
    username: str

    method: str
    request_body: str | None
    response_body: str | None
    status_code: int
    created_at: datetime

    model_config = ConfigDict(from_attributes=True)  # 允许从 ORM 对象创建
